/**
 * led8s595.h
 *
 * @author PIANO
 *
 */
#ifndef COMPONENTS_LED8S595_H
#define COMPONENTS_LED8S595_H

/**
 * includes
 */
#include "main.h"
#include <stdlib.h>
#include <string.h>

/**
 * defines
 */
#define DIO(PinState)		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, PinState)
#define RCLK(PinState)		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, PinState)
#define SCLK(PinState)		HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, PinState)

/**
 * functions
 */

uint8_t getTruthNumber(uint8_t number);
uint8_t getTruthLetter(uint8_t letter);
void led8s595SetInteger(int16_t value, uint8_t decimalDigits, uint8_t index);
void led8s595SetLong(int32_t value, uint8_t decimalDigits);
void led8s595SetFloat(float value, uint8_t index);
void led8s595SetDisplayBuffer(uint8_t *buffer, uint8_t index);
void led8s595SetFlash(int8_t index);

void led8s595Task1ms(void);

#endif
